#ifndef COMPONENT_CNC_COMM_PORT_MANAGER_H
#define COMPONENT_CNC_COMM_PORT_MANAGER_H

// required interfaces
// (empty)
// provided interfaces
#include "dataport.h"
#include "cooptask.h"
// include files

namespace cnc {

namespace comm {

class PortManager :
	protected virtual DataPort,
	protected virtual cnc::base::CooperativeTask
{
private: // required interface pointers
public: // constructor
	PortManager()
	{
	}
public: // required interfaces
public: // provided interfaces
	DataPort *getDataPort()
	{
		return static_cast<DataPort *>(this);
	}
	cnc::base::CooperativeTask *getTaskControl()
	{
		return static_cast<cnc::base::CooperativeTask *>(this);
	}
private: // Data Port implementation
	virtual DataStreamDevice *getDataStream(DataStreamID dataStreamID)
	{
		return nullptr;
	}
private: // Task Control implementation
	virtual bool start()
	{
		return false;
	}
	virtual bool execute()
	{
		return false;
	}
	virtual bool stop()
	{
		return false;
	}
public:
	static PortManager &instance()
	{
		static PortManager object;
		return object;
	}
};

} // namespace comm

} // namespace cnc

#endif
